package cn.wolfcode.luowowo.search.query;

import cn.wolfcode.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;

@Setter
@Getter
public class SearchQueryObject extends QueryObject {
    //条件类型
    public static final int CONDITION_TYPE_ABROAD = 0;
    public static final int CONDITION_TYPE_UNABROAD = 1;
    public static final int CONDITION_TYPE_THEME = 2;

    private String orderBy = "viewnum"; //排序字段
    private int type = -1;              //条件类型 国外/国内/主题     //搜索条件 -1全部/ 0目的地/ 1攻略/ 2游记/ 3找人
    private int typeValue = -1;         //条件值
    private Long destId = -1L;          //目的地id
    private String destNeme;            //目的地名称

    private Pageable pageable = PageRequest.of(getCurrentPage() - 1, getPageSize(),
            Sort.Direction.DESC, orderBy);
    private Pageable pageableWithoutSort = PageRequest.of(getCurrentPage() - 1, getPageSize());

}
